//
//  DCChatInputView.h
//  xmppBase
//
//  Created by striby on 16/1/8.
//  Copyright © 2016年 com.dc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DCEmojiBoardView.h"
#import "DCChatExtraView.h"
#import <AVFoundation/AVFoundation.h>
static const CGFloat toolBarHeight = 44;
static const CGFloat toolBtnWidth = 44;
static const CGFloat voiceInputWidth = 145;
static const CGFloat voiceInputImageViewWidth = 70;
static const int voiceImageViewTag =333;
static const int voiceInputStateFontSize =12;
static const int voiceStateLabelTag = 444;

@protocol DCChatInputViewDelegate <NSObject>

-(void)DCChatInputViewFrameChanged;

-(void)DCChatInputViewSendTextMessage:(NSString*)text;

-(void)DCChatVoiceInputRecored:(NSData*)voiceData isUserCanceled:(BOOL)isCanceled;

@end


@interface DCChatInputView : UIView<UITextViewDelegate,DCEmojiViewDelegate,AVAudioRecorderDelegate>
/**
 *  获取单例对象
 */
+(DCChatInputView*)shareInstance;

/**
 *  获取单例对象
 */
+(DCChatInputView*)getCurrentInstance;

/**
 *  文本输入
 */
@property(nonatomic,strong)UITextView * textInputView;

/**
 *  声音按钮
 */
@property(nonatomic,strong)UIButton * voiceBtn;

/**
 *  声音输入按钮
 */
@property(nonatomic,strong)UIButton * voiceInputView;

/**
 *  表情按钮
 */
@property(nonatomic,strong)UIButton * emojiBtn;
/**
 *  附加功能
 */
@property(nonatomic,strong)UIButton * extraBtn;
/**
 *  附加功能数组
 */
@property(nonatomic,strong)NSArray * extraItems;
/**
 *  附加功能视图 @[@{extraIcon:@"image.png",extraName:@"功能"} ]
 */
@property(nonatomic,strong)DCChatExtraView * chatExtraView;

/**
 *  绑定的tableView
 */
@property(nonatomic,weak)UITableView * bindingTableView;

/**
 *  代理
 */
@property(nonatomic,weak)id<DCChatInputViewDelegate,DCChatExtraViewDelegate> delegate;

/**
 *  隐藏 输入子视图
 */
-(void)hideAllInputViews;

/**
 *  输入视图是否已经展开
 */
-(BOOL)isInputViewFirstResponder;
/**
 *  是否处于录音状态
 */
-(BOOL)isVoiceIsFirstResponder;
@end
